import request from './request'

/**
 * 上传头像
 */
export const uploadAvatar = (file) => {
  const formData = new FormData()
  formData.append('file', file)
  
  return request.post('/upload/avatar', formData, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

/**
 * 删除头像
 */
export const deleteAvatar = (fileName) => {
  return request.delete('/upload/avatar', {
    params: { fileName }
  })
}
